home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _WordDocPrint.au3 < prev    next >
Encoding:
Text File  |  2007-09-08  |  1.4 KB  |  35 lines

  1. ; *******************************************************
  2. ; Example 1 - Create a word window, open a document, set the text,
  3. ;                print with defaults, and quit without saving changes.
  4. ; *******************************************************
  5. ;
  6. #include <Word.au3>
  7. $oWordApp = _WordCreate (@ScriptDir & "\Test.doc")
  8. $oDoc = _WordDocGetCollection ($oWordApp, 0)
  9. $oDoc.Range.Text = "This is some text to print."
  10. _WordDocPrint ($oDoc)
  11. _WordQuit ($oWordApp, 0)
  12.  
  13. ; *******************************************************
  14. ; Example 2 - Create a word window, open a document, set the text,
  15. ;                print using landscape, and quit without saving changes.
  16. ; *******************************************************
  17. ;
  18. #include <Word.au3>
  19. $oWordApp = _WordCreate (@ScriptDir & "\Test.doc")
  20. $oDoc = _WordDocGetCollection ($oWordApp, 0)
  21. $oDoc.Range.Text = "This is some text to print."
  22. _WordDocPrint ($oDoc, 0, 1, 1)
  23. _WordQuit ($oWordApp, 0)
  24.  
  25. ; *******************************************************
  26. ; Example 3 - Create a word window, open a document, set the text,
  27. ;                print to a printer named "My Printer", and quit without saving changes.
  28. ; *******************************************************
  29. ;
  30. #include <Word.au3>
  31. $oWordApp = _WordCreate (@ScriptDir & "\Test.doc")
  32. $oDoc = _WordDocGetCollection ($oWordApp, 0)
  33. $oDoc.Range.Text = "This is some text to print."
  34. _WordDocPrint ($oDoc, 0, 1, 0, 1, "My Printer")
  35. _WordQuit ($oWordApp, 0)